import { ref } from 'vue'
import { init } from '@/api/base'
import { toast } from '@/style'
import { t } from '@/lang'

// 进入引导页
export const boot = ref(false)

// 初始数据
export const initData = ref({
  hash_rate: 0
})

export const initUpdate = () => {
  return new Promise((resolve, reject) => {
    init().then(res => {
      initData.value = res
      resolve(initData.value)
    }).catch(err => {
      reject(err)
    })
  })
}

export const debug = (type) => {
  boot.value = type
}